import Vue from 'vue'
import Router from 'vue-router'

import login from '../views/login'
import register from '../views/register'
import teacherMain from '../views/TeacherMain'
import teacherProfile from '../views/user/Profile'
import courseList from '../views/user/List'
import notFound from '../views/NotFound'

Vue.use(Router)

export default new Router({
  mode: 'history',
  routes: [
    {
      path: '/',
      name: 'login',
      props: true,
      component: login
    },
    {
      path: '/register',
      name: 'register',
      props: true,
      component: register
    },
    {
      path: '/teacherMain/:user_name/:teacherid',
      name: 'teacherMain',
      props: true,
      component: teacherMain,
      children : [
        {
          path: '/teacherMain/teacherprofile/:user_name/:teacherid',
          name: 'teacherprofile',
          props: true,
          component: teacherProfile
        },
        {
          path: '/teacherMain/courselist/:user_name/:course_id/:course_name',
          name: 'courselist',
          props: true,
          component: courseList
        }
      ]
    },
    {
      path: '*',
      component: notFound
    }
  ]
})
